package com.itheima.web.controller;

import com.itheima.web.manager.ManageManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

public class ManageController {

    @Autowired
    private ManageManager manageManager;

    // 动态通过
    @PostMapping("/manage/messages/pass")
    public ResponseEntity pass(@RequestBody String[] ids) {

        Map map = manageManager.pass(ids);
        // 返回前端数据
        return ResponseEntity.ok(map);
    }

    // 动态拒绝
    @PostMapping("/manage/messages/reject")
    public ResponseEntity reject(@RequestBody String[] ids){
        Map map = manageManager.reject(ids);
        // 返回前端数据
        return ResponseEntity.ok(map);
    }
}
